<!DOCTYPE html>
<html ng-app="laAir">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>长龙航空</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/style.css">
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/Library/angular/angular1.4.8.min.js"></script>
    <script src="js/Library/angular/angular-cookies1.4.8.min.js"></script>
    <script src="js/Service/entityClass/laEntityClass.js?v=20171214"></script>
    <script src="js/Service/serviceImpl/laGlobalServiceImpl.js?v=20171214"></script>
    <script src="js/Service/serviceImpl/laOrderServiceImpl.js??v=20171214"></script>
    <script src="js/Service/serviceImpl/laUserServiceImpl.js?v=20171214"></script>
    <script src="js/Service/serviceImpl/laAir.js?v=20171214"></script>
    <script src="controller/searchPageCtl.js?v=20171214"></script>

</head>
<body class="MainBodyBg bodyFontSize" ng-controller="laAir_SearchCtl" >
<div class="container MainBgClor">
    <div class="row dongtaiChooseBox">
        <div class="col-sm-6 col-xs-6 col-lg-6 text-center dongtaiByNo"><span class="FontSize12">单程</span></div>
        <div class="col-sm-6 col-xs-6 col-lg-6 text-center dongtaiByCity"><span class="FontSize12">往返</span></div>
    </div>
    <div class="row dongtaiCityBox">
        <div class="col-sm-5 col-xs-5 col-lg-5"><input type="text" id="startCity" class="CityInput FontSize18" readonly/></div>
        <div class="col-sm-2 col-xs-2 col-lg-2"><img src="img/AppImg01.png" class="img-responsive center-block Img_Mid"/></div>
        <div class="col-sm-5 col-xs-5 col-lg-5 text-right"><input type="text" id="endCity" class="CityInput FontSize18 text-right" readonly/></div>
    </div>
    <div class="row dongtaiTimeBox">
        <div class="col-sm-6 col-xs-6 col-lg-6"><input type="text" class="TimeInput FontSize18" id="StartTime" ng-model="StartTime" readonly/>&nbsp;&nbsp;<span class="FontSize12 WeekDaySty">{{StartWeek}}</span></div>
        <div class="col-sm-6 col-xs-6 col-lg-6"><input type="text" class="TimeInput FontSize18" ng-model="EndTime" readonly/>&nbsp;&nbsp;<span class="FontSize12 WeekDaySty">{{EndWeek}}</span></div>
    </div>

</div>
<div class="container padTop20">
    <div>
        <button class="btn btn-block btn-circle btn-my FontSize10" id="test1"><span class="FontSize16">查询</span></button>
    </div>
</div>
<script>
    $(function () {

        // 获取手指在轮播图元素上的一个滑动方向（左右）

        // 获取界面上轮播图容器
        var $carousels = $('.carousel');
        var startX, endX;
        // 在滑动的一定范围内，才切换图片
        var offset = 50;
        // 注册滑动事件
        $carousels.on('touchstart', function (e) {
            // 手指触摸开始时记录一下手指所在的坐标x
            startX = e.originalEvent.touches[0].clientX;

        });
        $carousels.on('touchmove', function (e) {
            // 目的是：记录手指离开屏幕一瞬间的位置 ，用move事件重复赋值
            endX = e.originalEvent.touches[0].clientX;
        });
        $carousels.on('touchend', function (e) {
            //console.log(endX);
            //结束触摸一瞬间记录手指最后所在坐标x的位置 endX
            //比较endX与startX的大小，并获取每次运动的距离，当距离大于一定值时认为是有方向的变化
            var distance = Math.abs(startX - endX);
            if (distance > offset) {
                //说明有方向的变化
                //根据获得的方向 判断是上一张还是下一张出现
                $(this).carousel(startX > endX ? 'next' : 'prev');
            }
        });
        //自动播放
        $('.carousel').carousel({
            interval: 3000
        });
        $("#test1").click(function () {
            var NowTime=new Date().getTime();
            var postdata = {
                Type: "Function",
                Content: {
                    key:"StarTime",
                    value:$("#StartTime").val()
                },
                To: {
                    Target: "main",
                    Func: "setStorage"
                },
                From: {
                    Target: "pageSearch",
                    Func: "",
                    Serial: NowTime
                }
            };

            window.parent.postMessage(postdata, '*');
            var getdata = {
                Type: "Function",
                Content: {
                    key:"StarTime"
                },
                To: {
                    Target: "main",
                    Func: "getStorage"
                },
                From: {
                    Target: "pageSearch",
                    Func: "",
                    Serial: NowTime
                }
            };
            window.parent.postMessage(getdata, '*');
        });
        $("#startCity").click(function () {
            var NowTime=new Date().getTime();
            var postdata = {
                Type: "Function",
                Content: {
                    Id:"pageSearch",
                    HasFoot:false,
                    Url:""
                },
                To: {
                    Target: "main",
                    Func: "toFullScreen"
                },
                From: {
                    Target: "pageSearch",
                    Func: "",
                    Serial: NowTime
                }
            };
            window.parent.postMessage(postdata, '*');
        });
        $("#endCity").click(function () {
            var NowTime=new Date().getTime();
            var postdata = {
                Type: "Function",
                Content: {
                    Id:"pageSearch",
                    Height:"234px",
                    Url:"http://172.25.1.35:200/bannerPage.html"
                },
                To: {
                    Target: "main",
                    Func: "toScreen"
                },
                From: {
                    Target: "pageSearch",
                    Func: "",
                    Serial: NowTime
                }
            };
            window.parent.postMessage(postdata, '*');
        })
    });
    window.addEventListener('message', function (e) {
        if (e.source != window.parent) return;
        alert(e.data);
    }, false);
</script>
</body>
</html>
